__________________________________________________________________________________________________
class Solution:
    def maxDepthAfterSplit(self, seq: str) -> List[int]:
        a = 0
        b = 0
        n = len(seq)
        ans = [0] * n
        
        for i, c in enumerate(seq):
            if c == '(':
                if a < b:
                    a += 1
                    ans[i] = 0
                else:
                    b += 1
                    ans[i] = 1
            else:
                if a < b:
                    b -= 1
                    ans[i] = 1
                else:
                    a -= 1
                    ans[i] = 0
        
        return ans
__________________________________________________________________________________________________

__________________________________________________________________________________________________
